package com.core.dto;

import com.core.model.lxf.FileUpload;
import com.core.shared.file.FileHandle;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-8-13
 * Time: 上午11:01
 * To change this template use File | Settings | File Templates.
 */
public class FileUploadDTO {

    private String guid;
    private MultipartFile file;

    public FileUploadDTO() {
    }

    public FileUploadDTO(String guid, MultipartFile file) {
        this.guid = guid;
        this.file = file;
    }

    public static FileUpload toFileUpload(FileUploadDTO fileUploadDTO) {
        return FileHandle.toFile(fileUploadDTO.getFile());
    }

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public MultipartFile getFile() {
        return file;
    }

    public void setFile(MultipartFile file) {
        this.file = file;
    }
}
